package com.linjiu.easyphotos;

import android.app.Application;
import android.net.Uri;
import android.os.Build;

import com.linjiu.easyphotos.utils.file.FileUtils;

import java.io.File;

/**
 * 项目名称：com.linjiu.easyphotos
 * 创建人:LuoFG
 * 创建时间:2024/7/30  14:12
 * 描述:
 * 作用:
 */
public class EasyPhotoService {

    private static String TAG = "EasyPhotoService";

    private static class EasyPhotoServiceHolder {
        private static EasyPhotoService instance = new EasyPhotoService();
    }

    private static EasyPhotoService getInstance() {
        return EasyPhotoService.EasyPhotoServiceHolder.instance;
    }

    public static EasyPhotoService getService() {
        return getInstance();
    }

    private Application application;

    public Application getApplication() {
        return application;
    }

    public void setApplication(Application application) {
        this.application = application;
    }

    public File getCreateFileUriPath(){
        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
            if(application!=null) {
                String path = application.getFilesDir().getPath()+ "/Picture";
                File file = new File(path);
                if (!file.exists()) {
                    file.mkdirs();
                }
                return file;
            }
        }

        return null;
    }

}
